#!/usr/bin/ksh

####################################################
#AIX errpt monitor - run daily via crontab 
# - NOTE: currently setup for CST
#
# Christopher D. DeVille
####################################################


TODAY=$(/bin/date +%D)
TZ=GMT+29
YESTERDAY=$(/bin/date +%m%d%H%M%y)
TZ=CST6CDT
TEMP=/tmp/errpt.temp.$$
HOST=$(/usr/bin/hostname)

trap 'rm -f $TEMP ; exit 0' 0 1 2 15

errpt -A -s "$YESTERDAY" > "$TEMP"

if [ -s "$TEMP" ]
	then 
	/bin/mail -s "$HOST Error Report For $TODAY" admins@email.com  < "$TEMP"
fi

exit 0
